Skip to content

feat: add audio motion alerts to web UI - #13

Merged
johnoct merged 1 commit into
mainfrom
feat/audio-motion-alerts
Feb 6, 2026
Merged

feat: add audio motion alerts to web UI#13
johnoct merged 1 commit into
mainfrom
feat/audio-motion-alerts

Conversation

@johnoct

@johnoct johnoct commented Feb 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Plays an audio chime and vibrates the phone when motion is detected in the web UI
  • Solves the problem of macOS notifications being useless when monitoring from a phone
  • Bell button in the header toggles audio on/off (persisted via localStorage)
  • Uses Web Audio API (works over HTTP, no HTTPS/Service Worker needed)
  • Coexists with existing macOS osascript notifications

Why not Web Push?

Web Push requires HTTPS (secure context). BabyPing runs over HTTP on the LAN, so Service Workers won't register. Audio alerts achieve the same goal — phone makes noise when baby moves — with zero setup friction.

Test plan

  • 73 tests pass (3 new: bell button present, audio scripts present, vibration API present)
  • Manual: open web UI on phone, tap bell icon — confirm chime plays and bell turns amber
  • Manual: trigger motion — confirm chime plays on phone and macOS notification fires on Mac
  • Manual: refresh page — confirm bell state persists from localStorage
  • Manual: tap bell again to mute — confirm no sound on next motion event

Play a chime and vibrate the phone when motion is detected, so users
monitoring from a phone get alerted without relying on macOS notifications.

- Bell button in header to toggle audio alerts on/off
- Web Audio API two-tone chime (C5/E5) on new motion events
- Vibration API for mobile haptic feedback
- localStorage persists mute/unmute preference
- First-poll initialization prevents false alert on page load
- Coexists with existing macOS osascript notifications
- 73 tests passing (3 new)
@johnoct
johnoct merged commit 3ae7e68 into main Feb 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant